module.exports = function (fn, delay) {
    let timer = null;
    return function () {
        if (timer) {
            return;
        }
        timer = setTimeout(() => {
            fn();
            timer = null;
        }, delay);
    }
}